<template>
  <div class="poster">
    <div class="posterList" v-for="(temp,index) in miva" :key="index" @click="checked(temp)">
      <div class="posterImg">
        <el-image class="item-cover" :src="temp.poster | cover" fit="cover"></el-image>
      </div>
      <otherInfo :value="temp"></otherInfo>
    </div>
    <div class="layer" v-show="show" @click="show = false">
      <posterLayer></posterLayer>
    </div>
  </div>
</template>

<script>
import otherInfo from "@/components/otherInfo";
import posterLayer from "@/components/posterLayer";
export default {
  filters: {
    cover(posters) {
      if (!posters) return "http://placehold.it/640x1280";
      return posters.split(",")[0];
    }
  },
  components: {
    otherInfo,
    posterLayer
  },
  props: {
    miva: {
      type: [String, Array],
      default: ""
    }
  },

  data() {
    return {
      show: false
    };
  },
  methods: {
    checked(value) {
      // this.show = true;
      // this.nowCheck = value;
      console.log(value);
      this.$store.commit("SETTING_MASK", { type: "poster", data: value });
    }
  }
};
</script>

<style lang="less">
.poster {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  box-sizing: border-box;
  // padding: 10px 0;
  .posterList {
    width: 225px;
    height: 485px;
    overflow: hidden;
    margin: 15px 7px;
    background: #fff;
    box-shadow: 0px 2px 25px 0px rgba(189, 189, 189, 0.3);
    img {
      width: 100%;
    }
    .item-cover {
      height: 400px;
      border-radius: 5px 5px 0 0;
    }
    .posterImg {
      width: 100%;
      // height: 400px;
      // background: #dadada;
    }
  }
}
</style>

